import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    meta: {
      title: "",
    },
  },
  {
    path: "/sort/:id",
    name: "Sort",
    component: () => import("../views/Sort.vue"),
    props: true,
    meta: {
      title: "分类",
    },
  },
  {
    path: "/tag/:id",
    name: "Tag",
    component: () => import("../views/Tag.vue"),
    props: true,
    meta: {
      title: "标签",
    },
  },
  {
    path: "/summary",
    name: "Summary",
    component: () => import("../views/Summary.vue"),
    meta: {
      title: "归档",
    },
  },
  {
    path: "/dynamic",
    name: "Dynamic",
    component: () => import("../views/Dynamic.vue"),
    meta: {
      title: "动态",
    },
  },
  {
    path: "/friend",
    name: "Friend",
    component: () => import("../views/Friend.vue"),
    meta: {
      title: "友链",
    },
  },
  {
    path: "/about",
    name: "About",
    component: () => import("../views/About.vue"),
    meta: {
      title: "关于我",
    },
  },
  {
    path: "/article/:id",
    name: "Article",
    component: () => import("../views/Article.vue"),
    props: true,
    meta: {
      title: "文章详情",
    },
  },
];

const router = new VueRouter({
  routes,
});

export default router;
